package me.jiatao.viewmodel.model

import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel

const val NUMBER_KEY = "number_key"

class SavedStateViewModel(private val state: SavedStateHandle) : ViewModel() {
    var numberString: Int
        get() {
            return state.get<Int>(NUMBER_KEY) ?: 0
        }
        set(value) {
            state[NUMBER_KEY] = value
        }
}
